package com.yifeng.repo.micro.service.server.mps;

import feign.Param;
import feign.RequestLine;
import next.fire.mps.api.MpAppService;
import next.fire.mps.api.model.MpApp;
import next.fire.mps.api.model.MpAppTypeEnum;
import org.springframework.cloud.openfeign.FeignClient;

import java.util.Date;
import java.util.List;

@FeignClient(name = "mpsMpAppServiceClient", url = "${yfcloud.micro.service.mps.url}", path = "/fire-mps")
public interface MpAppServiceClient extends MpAppService {

    @Override
    @RequestLine("POST /MpAppService/listMpCode")
    List<String> listMpCode();

    @Override
    @RequestLine("POST /MpAppService/listMpApp")
    List<MpApp> listMpApp(@Param("merchantId") String merchantId, @Param("mpCode") String mpCode);

    @Override
    @RequestLine("POST /MpAppService/listMpApp")
    List<MpApp> listMpApp(@Param("merchantId") String merchantId, @Param("mpCode") String mpCode, @Param("mpAppType") MpAppTypeEnum mpAppType);

    @Override
    @RequestLine("POST /MpAppService/getSubscribeUrl")
    String getSubscribeUrl(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("appRedirectUrl") String appRedirectUrl,
                           @Param("validDate") Date validDate,@Param("state") String state, @Param("logo")boolean logo, @Param("perm") boolean perm);

    @Override
    @RequestLine("POST /MpAppService/getSubscribeUrlByAppParams")
    String getSubscribeUrlByAppParams(@Param("merchantId") String merchantId, @Param("mpAppId")String mpAppId, @Param("appRedirectUrl")String appRedirectUrl,
                                      @Param("validDate") Date validDate, @Param("appParams") String appParams, @Param("logo") boolean logo, @Param("perm") boolean perm);

    @Override
    @RequestLine("POST /MpAppService/getAppParamsByState")
    String getAppParamsByState(@Param("state") String state);

    @Override
    @RequestLine("POST /MpAppService/getOneOffSubscribeUrl")
    String getOneOffSubscribeUrl(@Param("state")String merchantId, @Param("mpAppId") String mpAppId, @Param("subscribeTemplateId") String subscribeTemplateId,
                                 @Param("appRedirectUrl") String appRedirectUrl, @Param("state") String state);

    @Override
    @RequestLine("POST /MpAppService/getAgentId")
    int getAgentId(@Param("appId") String appId, @Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId);
}
